Migration Guide from LevelPlay to XMediatorAds
Integration
This section helps you migrate from the LevelPlay to the XMediatorAds in your iOS projects.
Initialize the SDK Comparison
- Swift
- Objective-C
Operation | LevelPlay | XMediator |
---|---|---|
Set User ID | LPMInitRequestBuilder(appKey: "appKey").withUserId("user-id") | UserProperties(userId: "user-id") |
Set Test Mode | (Not available) | InitSettings(test: true) |
Set Extra Params | InitSettings(userProperties: UserProperties(customProperties: ...)) | |
SDK Initialization | LevelPlay.initWith(initRequest) { config, error in ... } | XMediatorAds.startWith(appKey: "appKey", initSettings: settings) { result in ... } |
Operation | LevelPlay | XMediator |
---|---|---|
Create | LPMInitRequestBuilder *requestBuilder = [[LPMInitRequestBuilder alloc] initWithAppKey:@"appKey"]; | |
Set User ID | [requestBuilder withUserId:@"UserId"]; | userProperties.userId = @"user-id"; |
Set Test Mode | (Not available) | initSettings.test = YES; |
Set Extra Params | initSettings.userProperties.customProperties = ...; | |
SDK Initialization | [LevelPlay initWithRequest:initRequest completion:^(LPMConfiguration *_Nullable config, NSError *_Nullable error){ ... }] | [X3MXMediatorAds startWithAppKey:@"<your-app-key>" initSettings:initSettings, callback:^(NSError * _Nullable error) {}] |
For more details, refer to:
Ad Formats
Banner Ads
Banner API Method Comparison
- Swift
- Objective-C
Operation | LevelPlay | XMediator |
---|---|---|
Create Banner | let banner = LPMBannerAdView(addUnitId: "addUnitId", config: adConfig) | XMediatorAds.banner.create(placementId: "placementId", size: .phone, viewController: self) |
Set Delegate | banner.delegate = self | XMediatorAds.banner.addDelegate(self) |
Load Banner | banner.loadAd(with: self) | (Auto-loaded on create) |
Show Banner | addSubview(banner) | addSubview(bannerView) |
Destroy/Remove | banner.destroy() |
Operation | LevelPlay | XMediator |
---|---|---|
Create Banner | ISBannerView *banner = [[ISBannerView alloc] initWithAppKey:@"appKey" placementName:@"Default"]; | X3MBannerView *bannerView = [X3MXMediatorAds.banner createWithPlacementId:@"placementId" size:X3MBannerSizePhone]; |
Set Delegate | banner.delegate = self; | [X3MXMediatorAds.banner addDelegate:self]; |
Load Banner | [self.banner loadAdWithViewController:self]; | (Auto-loaded on create) |
Show Banner | [self.view addSubview:banner]; | [self.view addSubview:bannerView]; |
Destroy/Remove | [banner removeFromSuperview]; |
Delegate Method Comparison
- Swift
- Objective-C
Event / Action | LevelPlay (LPMBannerAdViewDelegate ) | XMediator (BannerAdsDelegate ) |
---|---|---|
Banner Loaded | func didLoadAd(with adInfo: LPMAdInfo) | func didLoad(placementId: String, result: LoadResult) |
Failed to Load | func didFailToLoadAd(withAdUnitId adUnitId: String, error: Error) | Not exposed — handled internally |
Clicked | func didClickAd(with adInfo: LPMAdInfo) | func didClick(placementId: String) |
Impression Recorded | Not available by default | func didRecordImpression(placementId: String, data: ImpressionData) |
Event / Action | LevelPlay (LPMBannerAdViewDelegate ) | XMediator (BannerAdsDelegate ) |
---|---|---|
Banner Loaded | - (void)didLoadAdWithAdInfo:(LPMAdInfo *)adInfo; | - (void)didLoadWithPlacementId:(NSString *)placementId result:(X3MLoadResult *)result; |
Failed to Load | - (void)didFailToLoadAdWithAdUnitId:(NSString *)adUnitId error:(NSError *)error; | Not exposed — handled internally |
Clicked | - (void)didClickAdWithAdInfo:(LPMAdInfo *)adInfo; | - (void)didClickWithPlacementId:(NSString *)placementId; |
Failed to Display | - (void)didFailToDisplayAdWithAdInfo:(LPMAdInfo *)adInfo error:(NSError *)error; | — |
Impression Recorded | Not available by default | - (void)didRecordImpressionWithPlacementId:(NSString *)placementId data:(X3MImpressionData *)data; |
Key Differences: Banner Ads
Feature | LevelPlay | XMediator |
---|---|---|
Banner Creation | LPMBannerAdView | XMediatorAds.banner.create |
Banner Sizes | Phone, Tablet, Mrec, Adaptive | Phone, Tablet, Mrec |
Show Banner | Add view to container | Add view to container |
Impression Callback | Not available by default | Explicit callback per placement |
Delegate Protocol | LPMBannerAdViewDelegate | BannerAdsDelegate |
Ad Identifiers | Placement Name | Placement ID |
Retry Logic | Manual | Automatic (SDK handles retries) |
For more details, refer to: X3M Banner LevelPlay Banner
Interstitial Ads
Interstitial API Method Comparison
- Swift
- Objective-C
Operation | LevelPlay | XMediator |
---|---|---|
Create Interstitial | let interstitialAd = LPMInterstitialAd(adUnitId: "adUnitId") | (Auto-managed by SDK, no explicit object) |
Set Delegate | interstitialAd.delegate = self | XMediatorAds.interstitial.addDelegate(self) |
Load Interstitial | interstitialAd.loadAd() | XMediatorAds.interstitial.load(placementId: "...") |
Check Ready | interstitialAd.isReady() | XMediatorAds.interstitial.isReady(withPlacementId: ...) |
Show Interstitial | interstitialAd.show(viewController: viewController, placementName: nil) | XMediatorAds.interstitial.present(fromViewController: self, fromAdSpace: "interstitial-ad-space") |
Operation | LevelPlay | XMediator |
---|---|---|
Create Interstitial | interstitialAd = [[LPMInterstitialAd alloc] initWithAdUnitId:@"adUnitId"]; | (Auto-managed by SDK, no explicit object) |
Set Delegate | [interstitialAd setDelegate:self]; | [X3MXMediatorAds.interstitial addDelegate:self]; |
Load Interstitial | [interstitialAd loadAd]; | [X3MXMediatorAds.interstitial loadWithPlacementId:@"..."]; |
Check Ready | [interstitialAd isReady]; | [X3MXMediatorAds.interstitial isReadyWithPlacementId:@"..."] |
Show Interstitial | [interstitialAd showAdWithViewController:self placementName:nil]; | [X3MXMediatorAds.interstitial presentFromViewController:self fromAdSpace:@"interstitial-ad-space"]; |
Delegate Method Comparison
- Swift
- Objective-C
Event / Action | LevelPlay (LPMInterstitialAdDelegate ) | XMediator (InterstitialAdsDelegate ) |
---|---|---|
Loaded | func didLoadAd(with adInfo: LPMAdInfo) | func didLoad(placementId: String, result: LoadResult) |
Failed to Load | func didFailToLoadAd(withAdUnitId adUnitId: String, error: Error) | Not exposed — handled internally |
Presented | func didDisplayAd(with adInfo: LPMAdInfo) | func didPresent(placementId: String) |
Failed to Present | func didFailToDisplayAd(with adInfo: LPMAdInfo, error: Error) | func failedToPresent(placementId: String, error: PresentError) |
Impression Recorded | func didRecordImpression(placementId: String, data: ImpressionData) | |
Will Dismiss | func willDismiss(placementId: String) | |
Closed/Dismissed | func didCloseAd(with adInfo: LPMAdInfo) | func didDismiss(placementId: String) |
Clicked | func didClickAd(with adInfo: LPMAdInfo) | func didClick(placementId: String) |
Event / Action | LevelPlay (LPMInterstitialAdDelegate ) | XMediator (InterstitialAdsDelegate ) |
---|---|---|
Loaded | - (void)didLoadAdWithAdInfo:(LPMAdInfo *)adInfo; | - (void)didLoadWithPlacementId:(NSString * _Nonnull)placementId result:(X3MLoadResult * _Nonnull)result; |
Failed to Load | - (void)didFailToLoadAdWithAdUnitId:(NSString *)adUnitId error:(NSError *)error; | Not exposed — handled internally |
Presented | - (void)didDisplayAdWithAdInfo:(LPMAdInfo *)adInfo; | - (void)didPresentWithPlacementId:(NSString * _Nonnull)placementId; |
Failed to Present | - (void)didFailToDisplayAdWithAdInfo:(LPMAdInfo *)adInfo error:(NSError *)error; | - (void)failedToPresentWithPlacementId:(NSString * _Nonnull)placementId error:(NSError * _Nonnull)error; |
Impression Recorded | - (void)didRecordImpressionWithPlacementId:(NSString * _Nonnull)placementId data:(X3MImpressionData * _Nonnull)data; | |
Will Dismiss | - (void)willDismissWithPlacementId:(NSString * _Nonnull)placementId; | |
Closed/Dismissed | - (void)didCloseAdWithAdInfo:(LPMAdInfo *)adInfo; | - (void)didDismissWithPlacementId:(NSString * _Nonnull)placementId; |
Clicked | - (void)didClickAdWithAdInfo:(LPMAdInfo *)adInfo; | - (void)didClickWithPlacementId:(NSString * _Nonnull)placementId; |
Key Differences: Interstitial Ads
Feature | LevelPlay (LPMInterstitialAd ) | XMediator (InterstitialAdsDelegate ) |
---|---|---|
Ad Object | Explicit (LPMInterstitialAd ) | Auto-managed (no explicit object) |
Delegate Protocol | LPMInterstitialAdDelegate | InterstitialAdsDelegate |
Ad Identifiers | Ad Unit ID | Placement ID |
Load/Show | Performed on explicit object | Static call on SDK |
Impression Callback | On display | Explicit callback per placement |
Retry Logic | Manual | Automatic (SDK handles retries) |
Error Handling | Delegate methods with NSError /Error | Delegate methods with error objects |
For more details, refer to: X3M Interstitial LevelPlay Interstitial
Rewarded Ads
Rewarded API Method Comparison
- Swift
- Objective-C
Operation | LevelPlay | XMediator |
---|---|---|
Create Rewarded | LPMRewardedVideoAd.createWithPlacementId("...") | Not required - singleton via XMediatorAds.rewarded |
Set Delegate | rewardedAd.setDelegate(self) | XMediatorAds.rewarded.addDelegate(self) |
Load Rewarded | rewardedAd.loadAd() | XMediatorAds.rewarded.load(placementId: "...") |
Check Ready | rewardedAd.isAdReady() | XMediatorAds.rewarded.isReady() or XMediatorAds.rewarded.isReady(withPlacementId: ...) |
Show Rewarded | rewardedAd.showAd(viewController: self, placementName: nil) | XMediatorAds.rewarded.present(fromViewController: self, fromAdSpace: "rewarded-ad-space") |
Operation | LevelPlay | XMediator |
---|---|---|
Create Rewarded | LPMRewardedVideoAd.createWithPlacementId("...") | Not required - singleton via X3MXMediatorAds.rewarded |
Set Delegate | [rewardedAd setDelegate:self]; | [X3MXMediatorAds.rewarded addDelegate:self]; |
Load Rewarded | [IronSource loadISDemandOnlyRewardedVideo:@"instanceId"]; | [X3MXMediatorAds.rewarded loadWithPlacementId:@"..."]; |
Check Ready | [IronSource hasISDemandOnlyRewardedVideo:@"instanceId"] | [X3MXMediatorAds.rewarded isReadyWithPlacementId:@"..."] or [X3MXMediatorAds.rewarded isReadyWithPlacementId:@"..."] |
Show Rewarded | [self.interstitialAd showAdWithViewController:self placementName:NULL]; | [X3MXMediatorAds.rewarded presentWithPlacementId:@"..."]; |
Delegate Method Comparison
- Swift
- Objective-C
Event / Action | LevelPlay (LPMRewardedAdDelegate ) | XMediator (RewardedAdsDelegate ) |
---|---|---|
Loaded | func didLoadAd(with adInfo: LPMAdInfo) | func didLoad(placementId: String, result: LoadResult) |
Failed to Load | func didFailToLoadAd(withAdUnitId adUnitId: String, error: Error) | Not exposed — handled internally |
Displayed | func didDisplayAd(with adInfo: LPMAdInfo) | func didPresent(placementId: String) |
Failed to Present | func didFailToDisplayAd(with adInfo: LPMAdInfo, error: Error) | func failedToPresent(placementId: String, error: PresentError) |
Clicked | func didClickAd(with adInfo: LPMAdInfo) | func didClick(placementId: String) |
Closed/Dismissed | func didCloseAd(with adInfo: LPMAdInfo) | func didDismiss(placementId: String) |
Will Dismiss | func willDismiss(placementId: String) | |
Impression/Revenue | func didRecordImpression(placementId: String, data: ImpressionData) | |
Rewarded | func didRewardAd(with adInfo: LPMAdInfo, reward: LPMReward) | func didEarnReward(placementId: String) |
Event / Action | LevelPlay (LPMRewardedAdDelegate ) | XMediator (RewardedAdsDelegate ) |
---|---|---|
Loaded | - (void)didLoadAdWithAdInfo:(LPMAdInfo *)adInfo; | - (void)didLoadWithPlacementId:(NSString *)placementId result:(X3MLoadResult *)result; |
Failed to Load | - (void)didFailToLoadAdWithAdUnitId:(NSString *)adUnitId error:(NSError *)error; | Not exposed — handled internally |
Displayed | - (void)didDisplayAdWithAdInfo:(LPMAdInfo *)adInfo; | - (void)didPresentWithPlacementId:(NSString *)placementId; |
Failed to Present | - (void)didFailToDisplayAdWithAdInfo:(LPMAdInfo *)adInfo error:(NSError *)error; | - (void)failedToPresentWithPlacementId:(NSString *)placementId error:(NSError *)error; |
Clicked | - (void)didClickAdWithAdInfo:(LPMAdInfo *)adInfo; | - (void)didClickWithPlacementId:(NSString *)placementId; |
Closed/Dismissed | - (void)didCloseAdWithAdInfo:(LPMAdInfo *)adInfo; | - (void)didDismissWithPlacementId:(NSString *)placementId; |
Will Dismiss | — | - (void)willDismissWithPlacementId:(NSString *)placementId; |
Impression/Revenue | — | - (void)didRecordImpressionWithPlacementId:(NSString *)placementId data:(X3MImpressionData *)data; |
Rewarded | - (void)didRewardAdWithAdInfo:(LPMAdInfo *)adInfo reward:(LPMReward *)reward; | - (void)didEarnRewardWithPlacementId:(NSString *)placementId; |
Key Differences: Rewarded Ads
Feature | LevelPlay | XMediator |
---|---|---|
Reward Callback | didReceiveReward | didEarnReward |
Impression Callback | On display | Explicit callback per placement |
Delegate Protocol | ISDemandOnlyRewardedVideoDelegate | RewardedAdsDelegate |
Ad Identifiers | Instance ID | Placement ID |
Retry Logic | Manual | Automatic (SDK handles retries) |
Auto-load/Auto-retry | Manual | Automatic after dismiss/fail |